

$(function(){
    siteWindow('.win-fileupload');
    inputFocus('input,textarea');
	//1.收缩、展开
	$('.btntop').on('click',function(){
		$(this).toggleClass('active');
		$(this).parent().parent().find('.item').slideToggle(function(){
			$('.site-footer').css('position','initial');
			$(window).resize();
		});
	});
	
	
	//公司荣誉轮播图
	var $slide = $('.swiper-slide');
	if($slide.length>2){
		var mySwiperImg = new Swiper('.award-list',{
			speed:500,
			loop:true,
			initialSlide: 0,
			slidesPerView: 4,
			loopedSlides: 9,
			slideToClickedSlide: true,
			onlyExternal : true,			
			autoplayDisableOnInteraction : false
		});
		
		//2.轮播图2
		var swiperTable = new Swiper('.swiper-text',{
			speed:500,
			loop:true,
			effect : 'fade',
			fade: {
				crossFade: false,
			},
			onlyExternal : true,
			loopedSlides: 9,
			prevButton:'.line-award .topbtn',
			nextButton:'.line-award .nextbtn',
		});
    	swiperTable.params.control = mySwiperImg;
		mySwiperImg.params.control = swiperTable;
		

		return ;
	  
		

		var $first = $slide_text.first();
		$first.addClass('slide-text-active');
		$first.css('opacity','1');
		
		
		var index,oldindex;
		var maxindex = $slide_text.length-1;
		for(var i = 0;i<$slide_text.length-1;i++){
			if($slide_text.eq(i).hasClass('slide-text-active')){
				index = i;
				continue;
			}
		}
		
		var time = null;
		function prveLeft(){
			oldindex = index;
			if(index<=0){
	    		index=maxindex;
	    	}else{
	    		index -=1;
	    	}
			ani(index,oldindex);
		}
		function prveRight(){
			oldindex = index;
			if(index>=maxindex){
	    		index = 0;
	    	}else{
	    		index +=1;
	    	}
			ani(index,oldindex);
		}
		function ani(index,oldindex){
			
			$('.line-award .iconbtn').unbind('click');
			
			var $index = $slide_text.eq(index),
				$oldindex = $slide_text.eq(oldindex);
			$index.addClass('slide-text-active');
			$index.animate({
				opacity:'1'
			},500,function(){
				$('.line-award .topbtn').click(function(){
					prveLeft();
				});
				$('.line-award .nextbtn').click(function(){
					prveRight();
				});
			});
			$oldindex.removeClass('slide-text-active');
			$oldindex.animate({
				opacity:'0'
			},500);
		}
		
		$('.line-award .topbtn').click(function(){
			prveLeft();
		});
		$('.line-award .nextbtn').click(function(){
			prveRight();
		});
	}
});
